package com.love.marriage.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.connection.RedisConnectionFactory;

/**
 * description:  redis配置类
 * author:       majf
 * createDate:   2024/10/28 10:00
 * version:      1.0.0
 */
@Configuration
public class RedisConfig implements CommandLineRunner {

    @Autowired
    private RedisConnectionFactory redisConnectionFactory;

    @Override
    public void run(String... args) {
        redisConnectionFactory.getConnection().setConfig("notify-keyspace-events", "Ex");
    }
}